﻿using System;

using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;

namespace AndroidApplication2
{
    [Activity(Label = "AndroidApplication2", MainLauncher = true, Icon = "@drawable/icon")]
    public class Activity1 : Activity
    {
        int count = 1;
        string[] items;
        EditText text;
        

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // Get our button from the layout resource,
            // and attach an event to it
            Button button = FindViewById<Button>(Resource.Id.MyButton);
            ListView listview = FindViewById<ListView>(Resource.Id.listView2);
            text = FindViewById<EditText>(Resource.Id.editText1);

            items = new string[] { "Vegetables", "Fruits", "Flower Buds", "Legumes", "Bulbs", "Tubers" };
            HomeScreenAdapter ListAdapter = new HomeScreenAdapter(this, items);


            button.Click += delegate { 
                button.Text = string.Format("{0} clicks!", count++);
                text.Text += DateTime.Now.ToString("yyyy-mm-dd MM:HH:SS");
                
            };

            //ListAdapter = new ArrayAdapter<String>(this, Android.Resource.Layout.SimpleListItem1, items);
  

        }

        //protected override void OnListItemClick(ListView l, View v, int position, long id)
        //{
        //    var t = items[position];
        //    Android.Widget.Toast.MakeText(this, t, Android.Widget.ToastLength.Short).Show();
        //}
    }
}

